package classesBancodeDados;

import classesMiolo.FichaKey;
import classesMiolo.Infeccao;
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;

@Entity
@IdClass(FichaKey.class)
public class FichaNotificacaoInfeccao implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    private String nPront;
    @Id
    private String sus;
    
    private int leito;
    private String setor;
    private Infeccao infection;
    private String antibProfilatico;
    private String antibTerap;
    private String motivoNoAntib;

    public FichaNotificacaoInfeccao(String nPront, String sus, Infeccao infection,
                                    String antibProfilatico, String antibTerap,
                                    String motivoNoAntib, int leito, String setor) {
        this.nPront = nPront;
        this.sus = sus;
        this.infection = infection;
        this.antibProfilatico = antibProfilatico;
        this.antibTerap = antibTerap;
        this.motivoNoAntib = motivoNoAntib;
        this.leito = leito;
        this.setor = setor;
    }
    
    public FichaNotificacaoInfeccao(){
        this.nPront = "";
        this.sus = "";
        this.infection = new Infeccao();
        this.antibProfilatico = "";
        this.antibTerap = "";
        this.motivoNoAntib = "";
        this.leito = -1;
        this.setor = "";
    }

    public String getNumeroProntuario() {
        return nPront;
    }

    public void setNumeroProntuario(String nPront) {
        this.nPront = nPront;
    }

    public String getSus() {
        return sus;
    }

    public void setSus(String sus) {
        this.sus = sus;
    }

    public int getLeito() {
        return leito;
    }

    public void setLeito(int leito) {
        this.leito = leito;
    }   

    public Infeccao getInfection() {
        return infection;
    }

    public void setInfection(Infeccao infection) {
        this.infection = infection;
    }

    public String getAntibProfilatico() {
        return antibProfilatico;
    }

    public void setAntibProfilatico(String antibProfilatico) {
        this.antibProfilatico = antibProfilatico;
    }

    public String getAntibTerap() {
        return antibTerap;
    }

    public void setAntibTerap(String antibTerap) {
        this.antibTerap = antibTerap;
    }

    public String getMotivoNoAntib() {
        return motivoNoAntib;
    }

    public void setMotivoNoAntib(String motivoNoAntib) {
        this.motivoNoAntib = motivoNoAntib;
    }

    public String getSetor() {
        return setor;
    }

    public void setSetor(String setor) {
        this.setor = setor;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nPront != null ? nPront.hashCode() : 0);
        hash += (sus != null ? sus.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FichaNotificacaoInfeccao)) {
            return false;
        }
        FichaNotificacaoInfeccao other = (FichaNotificacaoInfeccao) object;
        if ((this.nPront == null && other.nPront != null) || (this.nPront != null && !this.nPront.equals(other.nPront))) {
            return false;
        }
        if ((this.sus == null && other.sus != null) || (this.sus != null && !this.sus.equals(other.sus))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "classesBancodeDados.FichaNotificacaoInfeccao[ nPront=" + nPront + ", sus=" + sus + " ]";
    }
    
}
